const Koa = require('koa')
const KoaBody = require('koa-body')
const app = new Koa()

const main = (ctx) => { 
console.log(ctx.request.body); // 只有post请求能用
ctx.body = `Request Body: ${JSON.stringify(ctx.request.body)}`
}

app.use(KoaBody())
app.use(main)
app.listen(3000, () => {
  console.log('项目已启动');
})